﻿using HandyControl.Controls;
using HandyControl.Tools;
using System.Windows;

namespace LpbPrj.Client.Controls;

/// <summary>
/// Thickness画刷
/// </summary>
public class ThicknessPropertyEditor : PropertyEditorBase
{
    public override FrameworkElement CreateElement(PropertyItem propertyItem)
    {
        var imageSelector = new ThicknessEx
        {
            IsEnabled = !propertyItem.IsReadOnly,
            HorizontalAlignment = HorizontalAlignment.Stretch,
            VerticalAlignment = VerticalAlignment.Center,
            Style = ResourceHelper.GetResource<System.Windows.Style>("ThicknessPathDefaultStyle"),
        };

        return imageSelector;
    }

    public override DependencyProperty GetDependencyProperty() => ThicknessEx.ThicknessProperty;
}

public class ThicknessLeftTopPropertyEditor : PropertyEditorBase
{
    public override FrameworkElement CreateElement(PropertyItem propertyItem)
    {
        var imageSelector = new ThicknessEx
        {
            IsEnabled = !propertyItem.IsReadOnly,
            HorizontalAlignment = HorizontalAlignment.Stretch,
            VerticalAlignment = VerticalAlignment.Center,
            Style = ResourceHelper.GetResource<System.Windows.Style>("ThicknessPathLeftTopDefaultStyle"),
        };

        return imageSelector;
    }

    public override DependencyProperty GetDependencyProperty() => ThicknessEx.ThicknessProperty;
}

public class ThicknessRightButtomPropertyEditor : PropertyEditorBase
{
    public override FrameworkElement CreateElement(PropertyItem propertyItem)
    {
        var imageSelector = new ThicknessEx
        {
            IsEnabled = !propertyItem.IsReadOnly,
            HorizontalAlignment = HorizontalAlignment.Stretch,
            VerticalAlignment = VerticalAlignment.Center,
            Style = ResourceHelper.GetResource<System.Windows.Style>("ThicknessPathRightButtomDefaultStyle"),
        };

        return imageSelector;
    }

    public override DependencyProperty GetDependencyProperty() => ThicknessEx.ThicknessProperty;
}
